package aircraft;

import java.awt.image.BufferedImage;

/**
 * 子弹
 */
public class AirBullet extends FlyingObject {
    private int speed;

    public AirBullet(int x, int y) {
        super(8, 20, x, y);
        speed = 5;
    }

    public void step() {
        y += speed;
    }


    @Override
    public BufferedImage getImage() {
        if (isLive()) {
            return Images.bullet;
        } else if (isDead()) {
            state = REMOVE;
        }
        return null;
    }

    public boolean isOutOfBounds() {
        return y <= -height;
    }

}
